package com.article.controller;

import com.apis.articles.SaveArticleContentApi;
import com.article.service.ApArticleContentService;
import com.usian.model.atri.pojos.ApArticleContent;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.common.enums.AppHttpCodeEnum;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/article/api/v1/article_content")
public class SaveArticleContent implements SaveArticleContentApi {

    @Resource
    ApArticleContentService apArticleContentService;


    @PostMapping("save")
    @Override
    public ResponseResult saveArticleContent(@RequestBody ApArticleContent apArticleContent) {
        apArticleContentService.save(apArticleContent);
        return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
    }
}
